import java.util.List;
import model.Game;
import model.Hockeyist;
import model.Move;
import model.Unit;
import model.World;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * @author Constantine
 */
public class Test extends HelpObject implements AbstractStrategy {

    public Test(Hockeyist self, World world, Game game, Move move) {
        super(self, world, game, move);
    }

    @Override
    public void run() {
        if (self.getTeammateIndex() == 1) {
            
        } else {
        }
        List<Unit> nearAheadUnits = getUnitsAhead(self, getOpps(self));
        if (!nearAheadUnits.isEmpty() && nearAheadUnits.get(0).getDistanceTo(self) < game.getStickLength() * 1.5d) {
            double oppAngle = Math.atan2(nearAheadUnits.get(0).getSpeedY(), nearAheadUnits.get(0).getSpeedX());
            double selfAngle = self.getAngle();
            move.setTurn(-Math.signum(selfAngle) * oppAngle - selfAngle);
            move.setSpeedUp(1.0d);
            return;
        }
    }

}
